package com.qy137.controller;

import com.qy137.service.IStaffService;
import com.qy137.utils.Result;
import com.qy137.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: qy137-back
 * @description:
 * @author: 皇子明
 * @create: 2021-08-27 22:22
 **/
@RestController
@RequestMapping("login")
@CrossOrigin
public class LoginController {
    @Autowired
    private IStaffService iStaffService;
    @PostMapping
    public Result login(@RequestBody LoginVo loginVo){
        return iStaffService.findByUserAndPassword(loginVo.getUsername(),loginVo.getPassword());
    }
}
